From 135a488c8306dbde1876c3ac0a08e80fb29d5c35 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 25 Apr 2007 18:12:03 +0100 Subject: [PATCH] hvm ioemu: Do not initialise the LSI SCSI interface if no SCSI discs are attached to the guest. Signed-off-by: Keir Fraser --- tools/ioemu/hw/pc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/ioemu/hw/pc.c b/tools/ioemu/hw/pc.c index a2063c06e4..0a9cd0db35 100644 --- a/tools/ioemu/hw/pc.c +++ b/tools/ioemu/hw/pc.c @@ -923,11 +923,12 @@ static void pc_init1(uint64_t ram_size, int vga_ram_size, char *boot_device, #else if (pci_enabled) { void *scsi; - - scsi = lsi_scsi_init(pci_bus, -1); for (i = 0; i < MAX_SCSI_DISKS ; i++) { - if (bs_table[i + MAX_DISKS]) - lsi_scsi_attach(scsi, bs_table[i + MAX_DISKS], -1); + if (!bs_table[i + MAX_DISKS]) + continue; + if (!scsi) + scsi = lsi_scsi_init(pci_bus, -1); + lsi_scsi_attach(scsi, bs_table[i + MAX_DISKS], -1); } } #endif /* !CONFIG_DM */ -- 2.30.2